var kk = [20,18,10,12,15,100,40];
for(var j=0; j<kk.length-1; j++){
    for(var i=0; i<kk.length - 1 - j; i++){
        if(kk[i]>kk[i+1]){
            var jk = kk[i];
            kk[i]=kk[i+1];
            kk[i+1]=jk;
        }
    }
}
console.log(kk);


